package com.exd.flink.common;

import org.apache.flink.api.java.utils.ParameterTool;

public class PropertiesTool {

	public static ParameterTool getParameterTool() {
		ParameterTool parameterTool = null;
		try {
//			parameterTool = ParameterTool.fromPropertiesFile("exd-flink.properties");
			parameterTool = ParameterTool.fromPropertiesFile(
					PropertiesTool.class.getClassLoader().getResourceAsStream("exd-flink.properties"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return parameterTool;
	}
	
	public static void main(String[] args) {
		ParameterTool parameterTool = PropertiesTool.getParameterTool();
		String kafkaIp = parameterTool.get("exd.kafka.bootstrap.servers");
		String tocpicName = parameterTool.get("exd.kafka.tocpic.name");
		String groupId = parameterTool.get("exd.kafka.group.id");
		System.out.println(kafkaIp+":"+tocpicName+":"+groupId);
	}

}
